package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.dto.BrandDTO;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {

    // 根据分类id查询品牌
    @Select("SELECT tb.id,tb.`name`,tb.letter, tb.image FROM tb_category_brand tcb inner join tb_brand tb on tcb.brand_id = tb.id where tcb.category_id=#{id}")
    List<Brand> queryBrandByCategoryId(@Param("id") Long id);
}
